<template>
  <!--视频审核-->
  <div>
    视频审核
    <table>
      <tr>
        <th>视频Id</th><th>发布者Id</th><th>视频播放地址</th><th>发布时间</th><th>是否审核</th><th>操作</th>
      </tr>
      <tr v-for="item in videos" :key="item.id">
        <td>{{item.id}}</td><td>{{item.upId}}</td><td>{{item.playUrl}}</td><td>{{item.upTime}}</td><td>{{item.approved}}</td><td><Button @click="check(item.id)">审核</Button></td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  name: "videoCheck",
  data(){
    return{
      videos:[],
    }
  },
  methods:{
    check(id){
      let params = new URLSearchParams()
      params.append('approve','1')
      params.append('managerId',sessionStorage.getItem('userId'))
      params.append('videoId',id)

      this.$http.post('/api/checkVideo',params).then(res=>{
        if(res.data.code === 200){
          this.$Message.success('操作成功')
        }
      })

    },

  },
  created(){
    //获取未审核视频
    this.$http.get('/api/getVideoWithoutCheck').then(res=>{
      this.videos = res.data.data.Videos
    }).catch(error=>{
      console.log(error)
    })
  }
}
</script>

<style scoped>

</style>
